<template>
  <!--  升学视图-->
  <!-- 将分类名和分类下的视频卡片信息通过props传给NormalModule组件 -->
  <!-- v-if 处理异步数据请求延迟问题，数据接收了再发送给子组件NormalModule -->
  <div v-for="(topic, index) in topicList" :key="index">
    <NormalModule :topic="topic" />
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue";
import NormalModule from "@/components/normalModule/NormalModule.vue";
// import { videoApi } from "@/api/video";
// import { VideoList } from "@/api/model/video";
export default defineComponent({
  name: "VideoView",
  components: {
    NormalModule,
  },
  setup() {
    // const page = "study";
    // 通过自定义类声明当前视图的接收回来的响应式数据
    // const videoList = reactive(new VideoList());
    // const topic: Array<string> = ["高数", "政治"];
    const topicList = reactive(["考研", "专升本"]);
    /* videoApi
      .getAllVideos({
        pageNum: 1,
        pageSize: 8,
        keyword: "康伯",
      })
      .then((response: any) => {
        // data就是一个类目数组的对象
        videoList.videos = response.data.data;
        console.log(videoList.videos);
      })
      .catch((error: any) => {
        console.log(error);
      }); */
    return {
      // videoList,
      topicList,
    };
  },
});
</script>

<style scoped>
</style>
